<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/20 0020
 * Time: 上午 10:22
 */
namespace app\api\controller;

use app\api\service\Token as TokenService;

class IntegralOrder extends BaseController{
    public function placeintegralOrder(){
        (new \app\common\validate\IntegralOrder())->goCheck();
        $products = input('post.products/a');
        $uid = TokenService::getCurrentUid();
        $orderdata= input('post.');
        $orderdata['tenantid'] = TokenService::getTenantid();
        unset($orderdata['products']);
        $IntegralOrder = new \app\api\service\IntegralOrder();
        $res = $IntegralOrder->place($uid,$orderdata,$products);
        if($res['pass']){
            return show(config('status.SUCCESS_STATUS'),'积分支付成功',$res);
        }else{
            return show(config('status.ERROR_STATUS'),$res['message'],$res);
        }
    }
}